﻿Public Class Packet
    Public Shared pEof As String = "[0x00]"
    Public Shared pSplit As String = Chr(192) & Chr(128)
End Class

Module mdlPackets
    Public Function getResponseMsg(ByVal head_code As String, ByVal sub_code As String, ByVal err_code As String)
        Select Case head_code
            Case "1" ' For Login Packet
                Select Case err_code
                    Case "0"
                        Return "Login Success"
                    Case "1"
                        Return "Cannot Login Twice"
                    Case "2"
                        Return "an User Already Connected With This Account"
                    Case "6"
                        Return "Server Cannot Complete Your Request"
                    Case "9"
                        Return "Invalid Username/Password"
                    Case Else
                        Return "Unknown Error"
                End Select

            Case "10" ' For User Change Data Packet
                Select Case sub_code
                    Case "1"
                        Return "Unknown Error"
                    Case "2"
                        Select Case err_code
                            Case "0"
                                Return "User Data has Changed"
                            Case "1"
                                Return "Server Can't Complete Your Request"
                            Case "2"
                                Return "New Password not Equals with Confirmation Password"
                            Case "3"
                                Return "Invalid Old Password"
                            Case "4"
                                Return "Please fill the form correctly"
                            Case Else
                                Return "Unknown Error"
                        End Select
                    Case Else
                        Return "Unknown Error"
                End Select
            Case Else
                Return "Invalid Request To Server"
        End Select
    End Function
End Module
